package com.eastcom.bm.service.impl;

import java.util.List;

import org.apache.log4j.Logger;
import com.eastcom.bm.atom.CalendarPolicy;
import com.eastcom.bm.dao.DAOFactory;
import com.eastcom.bm.dao.ICalendarPolicyDao;
import com.eastcom.bm.service.ICalendarPolicyService;
import com.eastcom.common.db.JDBCTemplate;
import com.eastcom.providor.BMSetting;


public class CalendarPolicyService implements ICalendarPolicyService {

	private static Logger log = BMSetting.getBMlog();
	
	public List<CalendarPolicy> getAllCalendarPolicy() {
		// TODO Auto-generated method stub
		try{
			ICalendarPolicyDao policyDao=DAOFactory.getInstance().getCalendarPolicyDao();
			return policyDao.getAllCalendarPolicy();
		}
		catch(Exception e){
			log.error("ICalendarPolicyService getAllCalendarPolicy error",e);
		}
		finally{
			JDBCTemplate.doSessionFinally();
		}
		
		return null;
	}

	public CalendarPolicy getCalendarPolicyByUUID(String policyUUID) {
		// TODO Auto-generated method stub
        try{
        	ICalendarPolicyDao policyDao=DAOFactory.getInstance().getCalendarPolicyDao();
			return policyDao.getCalendarPolicyByUUID(policyUUID);
		}
		catch(Exception e){
			log.error("ICalendarPolicyService getCalendarPolicyByUUID error",e);
		}
        finally{
        	JDBCTemplate.doSessionFinally();
		}
		
		return null;
	}

}
